def to_css_locator(name)
  case(name)
    when "callout"
      ".mapInfoWindow"
    when "footer promo last tile"
      ".promo.last"
    when "footer promo first tile"
      ".promo.first"
    when "address"
      "#mapSearch"
  end
end



When /^I wait for 10 seconds$/ do
  sleep(10)
end

def is_an_address_string?(str)
  #This function is to detect our special treat for the address string to deal with Google's data change issue
  true if str[/\(.+or.+\)/]

end

def all_street_types_with_brackets_from(original_address_string)
  original_address_string[/\(.+or.+\)/]

end

def all_street_types_from(address_string)
  #This function is a work around Google's data change issue.
  #The 'value' has to be in the specific format:
  #(St or St or Pde or Parade or Rd or Road)
  #eg. Parliament (Dr or Drive), Capital Hill ACT 2600, Australia
  #Return value:
  #Array: ["St", "Street", "Pde", "Parade", "Rd", "Road"]

  all_street_types_with_brackets = all_street_types_with_brackets_from address_string
  all_street_types_with_brackets[/[^\(\)]+/].split(" or ")
end
=begin
def extract_urls file_name
  file = File.open(file_name)
  url_data = {}
  doc = Nokogiri::XML(file)
  root = doc.root
  root.xpath("//*[name()='nbnco:redirectRule']").each do |u|
    from_url = u.at("//*[name()='nbnco:fromUrl']").inner_text
    to_url = u.at("//*[name()='nbnco:toUrl']").inner_text

    url_data = {
        :from_url => from_url,
        :to_url   => to_url
    }
  end
  return url_data
end
=end